package com.lantosec.hmrp.modules.form.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.form.vo.FormLayoutVO;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * 自定义表单布局 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("form_layout")
@ApiModel(value="自定义表单布局", description="自定义表单布局")
public class FormLayout extends BaseEntity<FormLayoutVO> {

    private static final long serialVersionUID = 1L;
    public FormLayout(FormLayoutVO vo){
        this.layoutId = vo.getLayoutId();
        this.tableId = vo.getTableId();
        this.layoutName = vo.getLayoutName();
        this.html = vo.getHtml();
        this.js = vo.getJs();
        this.css = vo.getCss();
        this.createDate = vo.getCreateDate();
        this.createUserId = vo.getCreateUserId();
        this.createUserName = vo.getCreateUserName();
    }

    @Override
    public FormLayoutVO convertToVO(){
        return new FormLayoutVO(this);
    }


    /**
     * ID
     */
    @TableId(value = "layout_id", type = IdType.ASSIGN_UUID)
    private String layoutId;

    /**
     * 表ID
     */
    private String tableId;

    /**
     * 表单布局名称
     */
    private String layoutName;

    /**
     * HTML数据
     */
    private String html;

    /**
     * JS数据
     */
    private String js;

    /**
     * CSS数据
     */
    private String css;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 创建用户ID
     */
    private String createUserId;

    /**
     * 创建用户名称
     */
    private String createUserName;


    public enum ColName {
        layout_id, table_id, layout_name, html, js, css, create_date, create_user_id, create_user_name, 
    }
}
